<template>
    <div>1111111我来获取数据

        <div v-for="(item, index) in cateList" :key="index">{{ item.name }}</div>
    </div>

</template>
<script>
    import { getCategory } from '@/api/test';

    export default {
        data() {
            return {
                cateList: []
            }
        },
        mounted() {
            this.getList()
        },
        methods: {
            getList() {
                console.log(111111111)
                getCategory({ parent_id: 0 }).then(response => {
                    this.cateList = response.data
                })
            }
        }
    }
</script>
